﻿namespace HuaWei
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraLayout;
    using DevExpress.XtraLayout.Utils;
    using HuaWei.CommClass;
    using HuaWei.CommComp;
    using HuaWei.Common;
    using HuaWei.Windows.Forms;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Windows.Forms;

    public class FrmJLDJSP : FrmBase
    {
        private BindingSource bindingSource;
        private BindingSource bindingSource1;
        private BindingSource bindingSource2;
        private BindingSource bindingSource3;
        private SimpleButton btnDel;
        private SimpleButton btnNext;
        private SimpleButton btnPre;
        private SimpleButton btnZXQ;
        private LookUpEdit cboSPJT;
        private GridColumn colBDS;
        private GridColumn colBQJLS;
        private GridColumn colDW;
        private GridColumn colJSJG;
        private GridColumn colJSS;
        private GridColumn colQDBH;
        private GridColumn colXMMC;
        private GridControl gridControl3;
        private GridControl gridControl4;
        private GridView gridView1;
        private GridView gridView2;
        private GroupControl groupControl2;
        private GroupControl groupControl3;
        private IContainer icontainer1 = null;
        private LabelControl labelControl1;
        private LayoutControl layoutControl1;
        private LayoutControlGroup layoutControlGroup1;
        private LayoutControlItem layoutControlItem1;
        private LayoutControlItem layoutControlItem2;
        private LayoutControlItem layoutControlItem3;
        private LayoutControlItem layoutControlItem4;
        private LayoutControlItem layoutControlItem5;
        private MemoEdit memoEdit1;
        private PanelControl panelControl1;
        private PanelControl panelControl2;
        private PanelControl panelControl4;
        private PictureEdit pictureEdit1;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
        private TextEdit textEdit;
        private TextEdit textEdit1;
        private TextEdit textEdit2;
        private TextEdit textEdit7;
        private TextEdit textEdit9;
        private RepositoryItemTextEdit repositoryItemTextEdit2;

        public FrmJLDJSP()
        {
            this.InitializeComponent();
        }

        private void bindingSource1_PositionChanged(object sender, EventArgs e)
        {
            string str = DHelp.GetObjValue(this.bindingSource1, "id", false);
            this.bindingSource.Filter = "pid='" + str + "'";
            this.bindingSource3.Filter = "pid='" + str + "'";
            this.method1();
            this.ControlFormStatus();
        }

        private void btnDel_Click(object sender, EventArgs e)
        {
            this.method3(1);
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            if (this.bindingSource1.Position <= this.bindingSource1.List.Count)
            {
                this.bindingSource1.Position++;
            }
        }

        private void btnPre_Click(object sender, EventArgs e)
        {
            if (this.bindingSource1.Position > 0)
            {
                this.bindingSource1.Position--;
            }
        }

        private void btnZXQ_Click(object sender, EventArgs e)
        {
            this.method3(2);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer1 != null))
            {
                this.icontainer1.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmJLDJSP_FormClosed(object sender, FormClosedEventArgs e)
        {
            base.Save();
        }

        private void FrmJLDJSP_Load(object sender, EventArgs e)
        {
        }

        public void IniFrm(DataSet dsSource, string qdjlid)
        {
            if (GParams.QCInfo.QCZT == -1)
            {
                this.cboSPJT.EditValueChanged += cboSPJT_EditValueChanged;
            }
            this.method2();
            base.ds = dsSource;
            base.ida = DBHelp.IniIDA();
            string exeStr = string.Format("select * from GCLCT where bdid='-1' or bdid='{0}'", GParams._BDID);
            base.dsQuery.Merge(base.ida.ExecuteDataSet(exeStr, CommandType.Text, "GCLCT"));
            this.bindingSource2.DataSource = base.dsQuery.Tables["GCLCT"];
            this.bindingSource1.DataSource = base.ds.Tables["QDJL_M"];
            this.bindingSource.DataSource = base.ds.Tables["QDJL_MX"];
            this.bindingSource3.DataSource = base.ds.Tables["QDJL_JSS"];
            base.ds.Tables["QDJL_JSS"].ColumnChanging += FrmJLDJSP_ColumnChanging;
            base.bsList.Add(this.bindingSource1);
            base.bsList.Add(this.bindingSource);
            base.bsList.Add(this.bindingSource3);
            int num = this.bindingSource1.Find("ID", qdjlid);
            this.bindingSource1.Position = num;
            this.method1();
            if (GParams.QCInfo.QCZT != -1)
            {
                this.btnDel.Enabled = false;
            }
        }

        void FrmJLDJSP_ColumnChanging(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Row.Table.Columns.Contains("JSS") && e.Column.ColumnName.Equals("JSS"))
            {
                string sExpression = e.ProposedValue.ToString();
                if (!sExpression.Equals(""))
                {
                    e.Row["JSJG"] = CHelp.EvalExpress(sExpression);
                }
            }
        }

        private void InitializeComponent()
        {
            this.icontainer1 = new Container();
            this.panelControl1 = new PanelControl();
            this.btnZXQ = new SimpleButton();
            this.btnDel = new SimpleButton();
            this.btnNext = new SimpleButton();
            this.btnPre = new SimpleButton();
            this.layoutControl1 = new LayoutControl();
            this.textEdit9 = new TextEdit();
            this.bindingSource1 = new BindingSource(this.icontainer1);
            //base.dataSets = new dataSets1();
            this.textEdit1 = new TextEdit();
            this.textEdit7 = new TextEdit();
            this.textEdit = new TextEdit();
            this.textEdit2 = new TextEdit();
            this.layoutControlGroup1 = new LayoutControlGroup();
            this.layoutControlItem5 = new LayoutControlItem();
            this.layoutControlItem1 = new LayoutControlItem();
            this.layoutControlItem2 = new LayoutControlItem();
            this.layoutControlItem3 = new LayoutControlItem();
            this.layoutControlItem4 = new LayoutControlItem();
            this.panelControl4 = new PanelControl();
            this.groupControl2 = new GroupControl();
            this.pictureEdit1 = new PictureEdit();
            this.groupControl3 = new GroupControl();
            this.memoEdit1 = new MemoEdit();
            this.gridControl3 = new GridControl();
            this.bindingSource3 = new BindingSource(this.icontainer1);
            this.gridView1 = new GridView();
            this.colBDS = new GridColumn();
            this.colJSS = new GridColumn();
            this.colJSJG = new GridColumn();
            this.gridControl4 = new GridControl();
            this.bindingSource = new BindingSource(this.icontainer1);
            this.gridView2 = new GridView();
            this.colQDBH = new GridColumn();
            this.colXMMC = new GridColumn();
            this.colDW = new GridColumn();
            this.colBQJLS = new GridColumn();
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.repositoryItemTextEdit2.BeginInit();
            this.repositoryItemLookUpEdit1 = new RepositoryItemLookUpEdit();
            this.bindingSource2 = new BindingSource(this.icontainer1);
            this.panelControl2 = new PanelControl();
            this.labelControl1 = new LabelControl();
            this.cboSPJT = new LookUpEdit();
            base.ds.BeginInit();
            base.dsQuery.BeginInit();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.layoutControl1.BeginInit();
            this.layoutControl1.SuspendLayout();
            this.textEdit9.Properties.BeginInit();
            ((ISupportInitialize)this.bindingSource1).BeginInit();
            this.textEdit1.Properties.BeginInit();
            this.textEdit7.Properties.BeginInit();
            this.textEdit.Properties.BeginInit();
            this.textEdit2.Properties.BeginInit();
            this.layoutControlGroup1.BeginInit();
            this.layoutControlItem5.BeginInit();
            this.layoutControlItem1.BeginInit();
            this.layoutControlItem2.BeginInit();
            this.layoutControlItem3.BeginInit();
            this.layoutControlItem4.BeginInit();
            this.panelControl4.BeginInit();
            this.panelControl4.SuspendLayout();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.pictureEdit1.Properties.BeginInit();
            this.groupControl3.BeginInit();
            this.groupControl3.SuspendLayout();
            this.memoEdit1.Properties.BeginInit();
            this.gridControl3.BeginInit();
            ((ISupportInitialize)this.bindingSource3).BeginInit();
            this.gridView1.BeginInit();
            this.gridControl4.BeginInit();
            ((ISupportInitialize)this.bindingSource).BeginInit();
            this.gridView2.BeginInit();
            this.repositoryItemLookUpEdit1.BeginInit();
            ((ISupportInitialize)this.bindingSource2).BeginInit();
            this.panelControl2.BeginInit();
            this.panelControl2.SuspendLayout();
            this.cboSPJT.Properties.BeginInit();
            base.SuspendLayout();
            this.panelControl1.Controls.Add(this.btnZXQ);
            this.panelControl1.Controls.Add(this.btnDel);
            this.panelControl1.Controls.Add(this.btnNext);
            this.panelControl1.Controls.Add(this.btnPre);
            this.panelControl1.Dock = DockStyle.Top;
            this.panelControl1.Location = new Point(0, 0);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(790, 0x1a);
            this.panelControl1.TabIndex = 0;
            this.btnZXQ.Dock = DockStyle.Left;
            this.btnZXQ.Location = new Point(0xa3, 2);
            this.btnZXQ.Name = "btnZXQ";
            this.btnZXQ.Size = new Size(0x3d, 0x16);
            this.btnZXQ.TabIndex = 14;
            this.btnZXQ.Tag = "-2";
            this.btnZXQ.Text = "转下期";
            this.btnZXQ.Visible = false;
            this.btnZXQ.Click += new EventHandler(this.btnZXQ_Click);
            this.btnDel.Dock = DockStyle.Left;
            this.btnDel.Location = new Point(0x66, 2);
            this.btnDel.Name = "btnDel";
            this.btnDel.Size = new Size(0x3d, 0x16);
            this.btnDel.TabIndex = 13;
            this.btnDel.Tag = "-2";
            this.btnDel.Text = "删除";
            this.btnDel.Click += new EventHandler(this.btnDel_Click);
            this.btnNext.Dock = DockStyle.Left;
            this.btnNext.Location = new Point(0x34, 2);
            this.btnNext.Name = "btnNext";
            this.btnNext.Size = new Size(50, 0x16);
            this.btnNext.TabIndex = 1;
            this.btnNext.Tag = "-3";
            this.btnNext.Text = "下一页";
            this.btnNext.Click += new EventHandler(this.btnNext_Click);
            this.btnPre.Dock = DockStyle.Left;
            this.btnPre.Location = new Point(2, 2);
            this.btnPre.Name = "btnPre";
            this.btnPre.Size = new Size(50, 0x16);
            this.btnPre.TabIndex = 0;
            this.btnPre.Tag = "-3";
            this.btnPre.Text = "上一页";
            this.btnPre.Click += new EventHandler(this.btnPre_Click);
            this.layoutControl1.Controls.Add(this.textEdit9);
            this.layoutControl1.Controls.Add(this.textEdit1);
            this.layoutControl1.Controls.Add(this.textEdit7);
            this.layoutControl1.Controls.Add(this.textEdit);
            this.layoutControl1.Controls.Add(this.textEdit2);
            this.layoutControl1.Dock = DockStyle.Top;
            this.layoutControl1.Location = new Point(0, 0x33);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new Size(790, 80);
            this.layoutControl1.TabIndex = 0x10;
            this.layoutControl1.Text = "layoutControl1";
            this.textEdit9.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "PZBH", true));
            this.textEdit9.Location = new Point(0x66, 2);
            this.textEdit9.Name = "textEdit9";
            this.textEdit9.Size = new Size(0x110, 0x15);
            this.textEdit9.StyleController = this.layoutControl1;
            this.textEdit9.TabIndex = 0;
            this.bindingSource1.DataMember = "QDJL_M";
            this.bindingSource1.PositionChanged += new EventHandler(this.bindingSource1_PositionChanged);
            this.textEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "BW", true));
            this.textEdit1.Location = new Point(0x1de, 0x1b);
            this.textEdit1.Name = "textEdit1";
            this.textEdit1.Size = new Size(310, 0x15);
            this.textEdit1.StyleController = this.layoutControl1;
            this.textEdit1.TabIndex = 10;
            this.textEdit7.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "QQZH", true));
            this.textEdit7.Location = new Point(0x1de, 2);
            this.textEdit7.Name = "textEdit7";
            this.textEdit7.Size = new Size(310, 0x15);
            this.textEdit7.StyleController = this.layoutControl1;
            this.textEdit7.TabIndex = 8;
            this.textEdit.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "TZBH", true));
            this.textEdit.Location = new Point(0x66, 0x1b);
            this.textEdit.Name = "textEdit10";
            this.textEdit.Size = new Size(0x110, 0x15);
            this.textEdit.StyleController = this.layoutControl1;
            this.textEdit.TabIndex = 9;
            this.textEdit2.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "ZJJGZSBH", true));
            this.textEdit2.Location = new Point(0x66, 0x34);
            this.textEdit2.Name = "textEdit11";
            this.textEdit2.Size = new Size(0x2ae, 0x15);
            this.textEdit2.StyleController = this.layoutControl1;
            this.textEdit2.TabIndex = 13;
            this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.False;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem5, this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem4 });
            this.layoutControlGroup1.Location = new Point(0, 0);
            this.layoutControlGroup1.Name = "layoutControlGroup1";
            this.layoutControlGroup1.Size = new Size(790, 80);
            this.layoutControlGroup1.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Text = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            this.layoutControlItem5.Control = this.textEdit2;
            this.layoutControlItem5.CustomizationFormText = "中间交工证书编号";
            this.layoutControlItem5.Location = new Point(0, 50);
            this.layoutControlItem5.Name = "layoutControlItem5";
            this.layoutControlItem5.Size = new Size(790, 30);
            this.layoutControlItem5.Text = "中间交工证书编号";
            this.layoutControlItem5.TextSize = new Size(0x60, 14);
            this.layoutControlItem1.Control = this.textEdit9;
            this.layoutControlItem1.CustomizationFormText = "凭证编号";
            this.layoutControlItem1.Location = new Point(0, 0);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new Size(0x178, 0x19);
            this.layoutControlItem1.Text = "凭证编号";
            this.layoutControlItem1.TextSize = new Size(0x60, 14);
            this.layoutControlItem2.Control = this.textEdit7;
            this.layoutControlItem2.CustomizationFormText = "起讫桩号";
            this.layoutControlItem2.Location = new Point(0x178, 0);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Size = new Size(0x19e, 0x19);
            this.layoutControlItem2.Text = "起讫桩号";
            this.layoutControlItem2.TextSize = new Size(0x60, 14);
            this.layoutControlItem3.Control = this.textEdit;
            this.layoutControlItem3.CustomizationFormText = "图纸编号";
            this.layoutControlItem3.Location = new Point(0, 0x19);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Size = new Size(0x178, 0x19);
            this.layoutControlItem3.Text = "图纸编号";
            this.layoutControlItem3.TextSize = new Size(0x60, 14);
            this.layoutControlItem4.Control = this.textEdit1;
            this.layoutControlItem4.CustomizationFormText = "部位";
            this.layoutControlItem4.Location = new Point(0x178, 0x19);
            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.Size = new Size(0x19e, 0x19);
            this.layoutControlItem4.Text = "部位";
            this.layoutControlItem4.TextSize = new Size(0x60, 14);
            this.panelControl4.Controls.Add(this.groupControl2);
            this.panelControl4.Controls.Add(this.groupControl3);
            this.panelControl4.Dock = DockStyle.Top;
            this.panelControl4.Location = new Point(0, 0x83);
            this.panelControl4.Name = "panelControl4";
            this.panelControl4.Size = new Size(790, 190);
            this.panelControl4.TabIndex = 0x11;
            this.groupControl2.Controls.Add(this.pictureEdit1);
            this.groupControl2.Dock = DockStyle.Fill;
            this.groupControl2.Location = new Point(2, 2);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0x297, 0xba);
            this.groupControl2.TabIndex = 1;
            this.groupControl2.Text = "计量草图及几何尺寸";
            this.pictureEdit1.Dock = DockStyle.Fill;
            this.pictureEdit1.Location = new Point(2, 0x17);
            this.pictureEdit1.Name = "pictureEdit1";
            this.pictureEdit1.Size = new Size(0x293, 0xa1);
            this.pictureEdit1.TabIndex = 0;
            this.groupControl3.Controls.Add(this.memoEdit1);
            this.groupControl3.Dock = DockStyle.Right;
            this.groupControl3.Location = new Point(0x299, 2);
            this.groupControl3.Name = "groupControl3";
            this.groupControl3.Size = new Size(0x7b, 0xba);
            this.groupControl3.TabIndex = 2;
            this.groupControl3.Text = "图形尺寸";
            this.memoEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "CC", true));
            this.memoEdit1.Dock = DockStyle.Right;
            this.memoEdit1.Location = new Point(-2, 0x17);
            this.memoEdit1.Name = "memoEdit1";
            this.memoEdit1.Size = new Size(0x7b, 0xa1);
            this.memoEdit1.TabIndex = 3;
            this.gridControl3.DataMember = null;
            this.gridControl3.DataSource = this.bindingSource3;
            this.gridControl3.Dock = DockStyle.Top; 
            this.gridControl3.EmbeddedNavigator.Buttons.Append.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.First.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Last.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Next.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.NextPage.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Prev.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.PrevPage.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Remove.Visible = false;
            this.gridControl3.EmbeddedNavigator.CustomButtons.AddRange(new NavigatorCustomButton[] { new NavigatorCustomButton(-1, 6, true, true, "添加", "Add"), new NavigatorCustomButton(-1, 7, true, true, "删除", "Del") });
            this.gridControl3.EmbeddedNavigator.TextLocation = NavigatorButtonsTextLocation.None;
            this.gridControl3.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(this.method21);
            this.gridControl3.Location = new Point(0, 0x141);
            this.gridControl3.MainView = this.gridView1;
            this.gridControl3.Name = "gridControl3";
            this.gridControl3.Size = new Size(790, 0x63);
            this.gridControl3.TabIndex = 0x12;
            this.gridControl3.UseEmbeddedNavigator = true;
            this.gridControl3.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1 });
            this.bindingSource3.DataMember = "QDJL_MX";
            this.bindingSource3.DataSource = base.dataSets;
            this.bindingSource3.AddingNew+=bindingSource3_AddingNew;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.colBDS, this.colJSS, this.colJSJG });
            this.gridView1.GridControl = this.gridControl3;
            this.gridView1.Name = "gridView1";
            //this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsCustomization.AllowFilter = false;
            this.gridView1.OptionsCustomization.AllowSort = false;
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.colBDS.Caption = "表达式";
            this.colBDS.FieldName = "BDS";
            this.colBDS.Name = "colBDS";
            this.colBDS.Visible = true;
            this.colBDS.VisibleIndex = 0;
            this.colBDS.Width = 0xf8;
            this.colJSS.Caption = "计算式";
            this.colJSS.FieldName = "JSS";
            this.colJSS.Name = "colJSS";
            this.colJSS.Visible = true;
            this.colJSS.VisibleIndex = 1;
            this.colJSS.Width = 0xe7;
            this.colJSJG.Caption = "计算结果";
            this.colJSJG.FieldName = "JSJG";
            this.colJSJG.Name = "colJSJG";
            this.colJSJG.Visible = true;
            this.colJSJG.VisibleIndex = 2;
            this.colJSJG.Width = 0x3d;
            this.gridControl4.DataMember = null;
            this.gridControl4.DataSource = this.bindingSource;
            this.gridControl4.Dock = DockStyle.Fill;
            this.gridControl4.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl4.Location = new Point(0, 420);
            this.gridControl4.MainView = this.gridView2;
            this.gridControl4.Name = "gridControl4";
            this.gridControl4.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit2 });
            this.gridControl4.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemLookUpEdit1 });
            this.gridControl4.Size = new Size(790, 0x94);
            this.gridControl4.TabIndex = 0x13;
            this.gridControl4.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView2 });
            this.bindingSource.DataMember = "QDJL_MX";
            this.bindingSource.DataSource = base.dataSets;
            this.gridView2.Columns.AddRange(new GridColumn[] { this.colQDBH, this.colXMMC, this.colDW, this.colBQJLS });
            this.gridView2.GridControl = this.gridControl4;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsCustomization.AllowFilter = false;
            this.gridView2.OptionsCustomization.AllowGroup = false;
            this.gridView2.OptionsCustomization.AllowSort = false;
            this.gridView2.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView2.OptionsView.ColumnAutoWidth = false;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.colQDBH.Caption = "清单编号";
            this.colQDBH.FieldName = "QDBH";
            this.colQDBH.Name = "colQDBH";
            this.colQDBH.OptionsColumn.AllowEdit = false;
            this.colQDBH.OptionsColumn.ReadOnly = true;
            this.colQDBH.Visible = true;
            this.colQDBH.VisibleIndex = 0;
            this.colQDBH.Width = 0x57;
            this.colXMMC.Caption = "项目名称";
            this.colXMMC.FieldName = "QDMC";
            this.colXMMC.Name = "colXMMC";
            this.colXMMC.OptionsColumn.AllowEdit = false;
            this.colXMMC.OptionsColumn.ReadOnly = true;
            this.colXMMC.Visible = true;
            this.colXMMC.VisibleIndex = 1;
            this.colXMMC.Width = 240;
            this.colDW.Caption = "单位";
            this.colDW.FieldName = "DW";
            this.colDW.Name = "colDW";
            this.colDW.OptionsColumn.AllowEdit = false;
            this.colDW.OptionsColumn.ReadOnly = true;
            this.colDW.Visible = true;
            this.colDW.VisibleIndex = 2;
            this.colDW.Width = 0x2f;
            this.colBQJLS.Caption = "本期计量数量";
            this.colBQJLS.ColumnEdit = this.repositoryItemTextEdit2;
            this.colBQJLS.FieldName = "BQJLS";
            this.colBQJLS.Name = "colBQJLS";
            this.colBQJLS.Visible = true;
            this.colBQJLS.VisibleIndex = 3;
            this.colBQJLS.Width = 0x54;
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.Mask.EditMask = "n3";
            this.repositoryItemTextEdit2.Mask.MaskType = MaskType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.repositoryItemTextEdit2.Spin += repositoryItemTextEdit2_Spin;
            this.repositoryItemLookUpEdit1.AutoHeight = false;
            this.repositoryItemLookUpEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit1.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("code", "Name1", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("value", "Name2") });
            this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
            this.repositoryItemLookUpEdit1.ShowHeader = false;
            this.bindingSource2.DataMember = "GCLCT";
            this.bindingSource2.DataSource = base.dataSets;
            this.panelControl2.Controls.Add(this.labelControl1);
            this.panelControl2.Controls.Add(this.cboSPJT);
            this.panelControl2.Dock = DockStyle.Top;
            this.panelControl2.Location = new Point(0, 0x1a);
            this.panelControl2.Name = "panelControl2";
            this.panelControl2.Size = new Size(790, 0x19);
            this.panelControl2.TabIndex = 0x15;
            this.labelControl1.Location = new Point(12, 5);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x18, 14);
            this.labelControl1.TabIndex = 8;
            this.labelControl1.Text = "批复";
            this.cboSPJT.DataBindings.Add(new Binding("EditValue", this.bindingSource1, "SPZT", true));
            this.cboSPJT.Location = new Point(0x2a, 2);
            this.cboSPJT.Name = "cboSPJT";
            this.cboSPJT.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboSPJT.Properties.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("code", "code", 50, FormatType.None, "", false, HorzAlignment.Near), new LookUpColumnInfo("value", "value", 20, FormatType.None, "", true, HorzAlignment.Near) });
            this.cboSPJT.Properties.DropDownRows = 4;
            this.cboSPJT.Properties.ExportMode = ExportMode.DisplayText;
            this.cboSPJT.Properties.ImmediatePopup = true;
            this.cboSPJT.Properties.NullText = "";
            this.cboSPJT.Properties.PopupSizeable = false;
            this.cboSPJT.Properties.PopupWidth = 20;
            this.cboSPJT.Properties.ShowHeader = false;
            this.cboSPJT.Properties.TextEditStyle = TextEditStyles.Standard;
            this.cboSPJT.Size = new Size(100, 0x15);
            this.cboSPJT.TabIndex = 7;
            this.cboSPJT.Tag = "-1";
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(790, 0x238);
            base.Controls.Add(this.gridControl4);
            base.Controls.Add(this.gridControl3);
            base.Controls.Add(this.panelControl4);
            base.Controls.Add(this.layoutControl1);
            base.Controls.Add(this.panelControl2);
            base.Controls.Add(this.panelControl1);
            base.Name = "FrmJLDJSP";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "计量审批";
            base.FormClosed += new FormClosedEventHandler(this.FrmJLDJSP_FormClosed);
            base.Load += new EventHandler(this.FrmJLDJSP_Load);
            base.ds.EndInit();
            base.dsQuery.EndInit();
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.layoutControl1.EndInit();
            this.layoutControl1.ResumeLayout(false);
            this.textEdit9.Properties.EndInit();
            ((ISupportInitialize)this.bindingSource1).EndInit();
            base.dataSets.EndInit();
            this.textEdit1.Properties.EndInit();
            this.textEdit7.Properties.EndInit();
            this.textEdit.Properties.EndInit();
            this.textEdit2.Properties.EndInit();
            this.layoutControlGroup1.EndInit();
            this.layoutControlItem5.EndInit();
            this.layoutControlItem1.EndInit();
            this.layoutControlItem2.EndInit();
            this.layoutControlItem3.EndInit();
            this.layoutControlItem4.EndInit();
            this.panelControl4.EndInit();
            this.panelControl4.ResumeLayout(false);
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.pictureEdit1.Properties.EndInit();
            this.groupControl3.EndInit();
            this.groupControl3.ResumeLayout(false);
            this.memoEdit1.Properties.EndInit();
            this.gridControl3.EndInit();
            ((ISupportInitialize)this.bindingSource3).EndInit();
            this.gridView1.EndInit();
            this.gridControl4.EndInit();
            ((ISupportInitialize)this.bindingSource).EndInit();
            this.gridView2.EndInit();
            this.repositoryItemLookUpEdit1.EndInit();
            ((ISupportInitialize)this.bindingSource2).EndInit();
            this.panelControl2.EndInit();
            this.panelControl2.ResumeLayout(false);
            this.panelControl2.PerformLayout();
            this.cboSPJT.Properties.EndInit();
            base.ResumeLayout(false);
        }
        void repositoryItemTextEdit2_Spin(object sender, SpinEventArgs e)
        {
            e.Handled = true;
        }

        private void method1()
        {
            string key = DHelp.GetObjValue(this.bindingSource1, "JLCT", false);
            int num = this.bindingSource2.Find("ctlj", key);
            if (num != -1)
            {
                this.bindingSource2.Position = num;
                byte[] buffer = (byte[])DHelp.GetDataRow(this.bindingSource2)["CT"];
                using (MemoryStream stream = new MemoryStream(buffer))
                {
                    this.pictureEdit1.Image = Image.FromStream(stream);
                }
            }
        }

        private void method2()
        {
            DataTable table = new DataTable();
            table.Columns.Add("code", typeof(int));
            table.Columns.Add("value", typeof(string));
            DataRow row = table.NewRow();
            row["code"] = -1;
            row["value"] = "";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 0;
            row["value"] = "通过";
            table.Rows.Add(row);
            this.cboSPJT.Properties.DataSource = table;
            this.cboSPJT.Properties.DisplayMember = "value";
            this.cboSPJT.Properties.ValueMember = "code";
        }

        private void method3(int numD)
        {
            string msg = "";
            if (this.bindingSource1.List.Count > 0)
            {
                if (numD.Equals(1))
                {
                    msg = "是否删除当前计量？";
                }
                else
                {
                    msg = "是否当前计量转下期？";
                }
                if (MsgBox.ShowQuestion(msg) == System.Windows.Forms.DialogResult.OK)
                {
                    DataTable tDt = base.ds.Tables["QDJL_M3"];
                    DataTable table2 = base.ds.Tables["QDJL_MX3"];
                    DataTable table3 = base.ds.Tables["QDJL_JSS3"];
                    base.sqlList.Clear();
                    DHelp.GetObjId(this.bindingSource1);
                    while (this.bindingSource.List.Count > 0)
                    {
                        DataRow row = (this.bindingSource.Current as DataRowView).Row;
                        if (table2 != null)
                        {
                            DHelp.CopyItemArrayOverlap(table2, row, false);
                        }
                        this.bindingSource.RemoveCurrent();
                    }
                    while (this.bindingSource3.List.Count > 0)
                    {
                        DataRow row2 = (this.bindingSource3.Current as DataRowView).Row;
                        if (table3 != null)
                        {
                            DHelp.CopyItemArrayOverlap(table3, row2, false);
                        }
                        this.bindingSource3.RemoveCurrent();
                    }
                    DataRow row3 = (this.bindingSource1.Current as DataRowView).Row;
                    if (tDt != null)
                    {
                        DataRow row4 = DHelp.CopyItemArrayOverlap(tDt, row3, false);
                        row4["SPZT"] = numD;
                        row4.EndEdit();
                    }
                    this.bindingSource1.RemoveCurrent();
                    base.Save();
                }
            }
        }

        private void cboSPJT_EditValueChanged(object sender, EventArgs e)
        {
            if (cboSPJT.SelectedText == "通过")
            {
                this.colBQJLS.OptionsColumn.ReadOnly = true;
                textEdit.Properties.ReadOnly = true;
                textEdit1.Properties.ReadOnly = true;
                textEdit2.Properties.ReadOnly = true;
                textEdit7.Properties.ReadOnly = true;
                textEdit9.Properties.ReadOnly = true;
                memoEdit1.Properties.ReadOnly = true;
                colBDS.OptionsColumn.ReadOnly = true;
                colJSS.OptionsColumn.ReadOnly = true;
                colJSJG.OptionsColumn.ReadOnly = true;
            }
            else
            {
                this.colBQJLS.OptionsColumn.ReadOnly = false;
                textEdit.Properties.ReadOnly = false;
                textEdit1.Properties.ReadOnly = false;
                textEdit2.Properties.ReadOnly = false;
                textEdit7.Properties.ReadOnly = false;
                textEdit9.Properties.ReadOnly = false;
                memoEdit1.Properties.ReadOnly = false;
                colBDS.OptionsColumn.ReadOnly = false;
                colJSS.OptionsColumn.ReadOnly = false;
                colJSJG.OptionsColumn.ReadOnly = false;
            }
        }
        private void method21(object sender, NavigatorButtonClickEventArgs e)
        {
            if (e.Button.Tag.Equals("Add"))
            {
                this.bindingSource3.AddNew();
            }
            else if ((e.Button.Tag.Equals("Del") && (this.bindingSource3.List.Count > 0)) && (MsgBox.ShowQuestion("是否删除当前选中的计算表达式？") == System.Windows.Forms.DialogResult.OK))
            {
                this.bindingSource3.RemoveCurrent();
            }
        }

        private void bindingSource3_AddingNew(object sender, AddingNewEventArgs e)
        {
            this.bindingSource1.EndEdit();
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource1);
            BindingSource source = (BindingSource)sender;
            DataRowView view2 = ((DataView)source.List).AddNew();
            view2["id"] = Guid.NewGuid();
            view2["pid"] = dataRow["ID"];
            if (source.Count == 1)
            {
                source.EndEdit();
            }
            source.MoveLast();
            e.NewObject = dataRow;
        }
    }
}

